//
//  commonCell.m
//  SSSAllRollAgency
//
//  Created by Darker on 2017/3/15.
//  Copyright © 2017年 Darker. All rights reserved.
//

#import "commonCell.h"

@implementation commonCell

- (instancetype)
initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUpSubViews];
    }
    return self;
}
- (void)setUpSubViews{
    
     _lineView = [[UIView alloc]init];
    [self addSubview:_lineView];
    _lineView.backgroundColor = [UIColor colorWithHex:@"F0F0F0"];
    _lineView.sd_layout
    .bottomEqualToView(self)
    .leftEqualToView(self)
    .rightEqualToView(self)
    .heightIs(0.5);
    
    _nameLabel = [[UILabel alloc]init];
    _nameLabel.textColor = [UIColor colorWithHex:@"6D6D6D"];
    _nameLabel.textAlignment = NSTextAlignmentLeft;
    _nameLabel.font = [SSSFont systemFontOfSize:15];
    [self addSubview:_nameLabel];
    _nameLabel.sd_layout
    .leftSpaceToView(self,WidthIos6CompeteWithCurrent(15))
    .centerYEqualToView(self)
    .widthIs(WidthIos6CompeteWithCurrent(160))
    .heightIs(HeigthIos6CompeteWithCurrent(35));
    
    //箭头
    UIButton *arowBtn = [[UIButton alloc]init];
    [arowBtn setBackgroundImage:[UIImage imageNamed:@"icon_arrows_right"] forState:UIControlStateNormal];
    [self addSubview:arowBtn];
    arowBtn.sd_layout
    .centerYEqualToView(self)
    .rightSpaceToView(self,WidthIos6CompeteWithCurrent(15))
    .widthIs(WidthIos6CompeteWithCurrent(8))
    .heightIs(HeigthIos6CompeteWithCurrent(14));
    
    _subTitle = [[UILabel alloc]init];
    _subTitle.textColor = [UIColor colorWithHex:@"BBBBBB"];
    _subTitle.textAlignment = NSTextAlignmentRight;
    _subTitle.font = [SSSFont systemFontOfSize:15];
    [self addSubview:_subTitle];
    _subTitle.sd_layout
    .rightSpaceToView(arowBtn,WidthIos6CompeteWithCurrent(5))
    .centerYEqualToView(self)
    .leftEqualToView(_nameLabel)
    .autoHeightRatio(0);

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
